home *** CD-ROM | disk | FTP | other *** search
/ MacTech 1 to 12 / MacTech-vol-1-12.toast / Source / MacTech® Magazine / Volume 06 - 1990 / 06.07 Jul 90 / Printing Primer ƒ / EndReport.c < prev    next >
Encoding:
C/C++ Source or Header  |  1989-11-07  |  1.4 KB  |  64 lines  |  [TEXT/KAHL]

  1. /*******************************************\
  2. *    file:         EndReport.c                    *
  3. *    version:    0.1ß                        *
  4. *     XCMD ID        501                            *
  5. *                                            *
  6. * Closes down the current document and         *
  7. * deallocates the report's memory            *
  8. *                                            *
  9. *                                            *
  10. * -----------------------------------------    *
  11. * By:    Donald Koscheka                        *
  12. * Date:    30-OCT-89                            *
  13. * ©    Copyright 1989, Donald Koscheka            *
  14. *    All Rights Reserved                        *
  15. *                                            *
  16. * -----------------------------------------    *
  17. \*******************************************/
  18.  
  19. #include <MacTypes.h>
  20. #include <MemoryMgr.h>
  21. #include <ResourceMgr.h>
  22. #include <OSUtil.h>
  23. #include <HyperXCmd.h>
  24. #include <HyperUtils.h>
  25. #include <PrintMgr.h>
  26. #include "ReportUtils.h"
  27.  
  28.  
  29. pascal void main( paramPtr )
  30.     XCmdBlockPtr    paramPtr;
  31. /**********************************
  32. *
  33. *
  34. **********************************/
  35. {
  36.     Handle        pH;
  37.     pInfoPtr    pp;
  38.     short        oldRes;
  39.     
  40.     if( pH = GetSystemResource( PAGE_INFO, PAGE_ID ) ){
  41.         pp = (pInfoPtr)*pH;
  42.  
  43.         /*** shut the printing down ***/
  44.         PrClosePage( pp->prPort );
  45.         PrCloseDoc( pp->prPort );
  46.         
  47.         if( (*(pp->prRecHandle))->prJob.bJDocLoop ==  bSpoolLoop && !PrError() )
  48.             PrPicFile( pp->prRecHandle, NIL, NIL, NIL, &pp->myStRec );
  49.  
  50.         PrClose();
  51.         
  52.         /*** deallocate our memory    ***/
  53.         DisposHandle( (Handle)pp->prRecHandle );
  54.         
  55.         TrashHandle( pp->footNote.key1 );
  56.         TrashHandle( pp->footNote.key2 );
  57.         TrashHandle( pp->footNote.key3 );
  58.         
  59.         RemoveSystemResource( pH );
  60.     }
  61.     
  62.     paramPtr->returnValue = NIL;
  63. }
  64.